<html>
<head><meta charset="utf-8"><title>Expose LLVM Symbols · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html">Expose LLVM Symbols</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="243831777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/243831777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manuel Drehwald <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#243831777">(Jun 24 2021 at 19:03)</a>:</h4>
<p>I have been looking into <a href="https://github.com/rust-lang/rust/pull/82734#issuecomment-790102203">https://github.com/rust-lang/rust/pull/82734#issuecomment-790102203</a><br>
I would like to find symbols which are needed by the LLVM Plugin Enzyme and currently are not available in the default LLVM build, in order to enable them.<br>
While a shared lib llvm build does solve this problem for now it seems undesirable to require a special build process for this plugin.<br>
Since these symbols are already exposed in some configurations I don't expect real drawbacks from exposing this specific set of needed symbols, but I am also new to this area, so please correct me if I miss something. It might also be easier to argue about it once I have a complete list.</p>



<a name="243832454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/243832454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manuel Drehwald <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#243832454">(Jun 24 2021 at 19:08)</a>:</h4>
<p>With respect to the example given in the thread (_ZN4llvm2cl18GenericOptionValue6anchorEv), I did find  the GenericOptionValue in llvm-project/llvm/include/llvm/Support/CommandLine.h.<br>
Just looking at this single example, what would be the preferred step to make it available? I've been scrolling through the rustc dev guide, but I'm not sure about the right place for this.</p>



<a name="243834291"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/243834291" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#243834291">(Jun 24 2021 at 19:24)</a>:</h4>
<p>Shared lib LLVM is incompatible with LTO of rustc+LLVM (and I think also LLVM alone) afaik, which makes rustc slower.</p>



<a name="243834449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/243834449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manuel Drehwald <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#243834449">(Jun 24 2021 at 19:25)</a>:</h4>
<p>Well this sounds like just another reason for the work I intend to do, or did I get you wrong?</p>



<a name="243835114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/243835114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#243835114">(Jun 24 2021 at 19:31)</a>:</h4>
<p>If LTO is used, as little symbols as possible should be exported to ensure that the compiler has maximal freedom in optimizing.</p>



<a name="243835693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/243835693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manuel Drehwald <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#243835693">(Jun 24 2021 at 19:35)</a>:</h4>
<p>Where would I export the named symbol?</p>



<a name="243837531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/243837531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manuel Drehwald <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#243837531">(Jun 24 2021 at 19:51)</a>:</h4>
<p>A check (either at compiler or application build time) might make sense later before creating a PR, <br>
but first I would like to find out how many symbols are affected and what needs to be changed for that in the first place.</p>



<a name="243837964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/243837964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#243837964">(Jun 24 2021 at 19:54)</a>:</h4>
<p>I have no idea how to export it.</p>



<a name="243838085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/243838085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manuel Drehwald <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#243838085">(Jun 24 2021 at 19:55)</a>:</h4>
<p>Ok, then I will keep searching. But thanks for the heads-up regarding the performance.</p>



<a name="244024919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244024919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manuel Drehwald <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244024919">(Jun 26 2021 at 17:18)</a>:</h4>
<p>Would it be valid to add dummy function calls from rustc, to indicate that this symbols might be needed and aren't automatically dropped?<br>
I got a hint from an llvm dev who mentioned that this is occasionally used as a simple solution for such issues.</p>



<a name="244028519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244028519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244028519">(Jun 26 2021 at 18:40)</a>:</h4>
<p>You will want shared system llvm build version to use plugins no matter what so I don't see much of a point.</p>



<a name="244038458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244038458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manuel Drehwald <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244038458">(Jun 26 2021 at 22:58)</a>:</h4>
<p>Why would it still require the shared system llvm, once the symbols issue is fixed?<br>
I think that clang is able to expose llvm's plugin interface without this requirement.<br>
Is there a technical reason on the rust side?</p>



<a name="244040407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244040407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244040407">(Jun 26 2021 at 23:46)</a>:</h4>
<p>We don't really want to allow LLVM we ship to be used or interacted with by the end users directly. For multiple reasons, but it gives us freedom to optimize our distribution as we wish, primarily.</p>



<a name="244040582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244040582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244040582">(Jun 26 2021 at 23:50)</a>:</h4>
<p>we don't ship the llvm-config binary for a similar reason.</p>



<a name="244040600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244040600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244040600">(Jun 26 2021 at 23:51)</a>:</h4>
<p>now if you build rustc with an external LLVM, the story is a little different – we do actively support this use-case; and since LLVM is coming from an external source, its up to external source to ensure compatibility and what other things.</p>



<a name="244041384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244041384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manuel Drehwald <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244041384">(Jun 27 2021 at 00:11)</a>:</h4>
<p>Regarding your last message: This is indeed helpful for me to debug, but I guess it's hard to tell all Rust-AD folks to just build their own rustc version.</p>



<a name="244041397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244041397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manuel Drehwald <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244041397">(Jun 27 2021 at 00:11)</a>:</h4>
<p>One solution I could imagine is having something like cargo-enzyme, which builds an Enzyme compatible rustc version (+Enzyme) to create the gradient functions. This way I could hide all this from end-users. <br>
We could then bundle all generated gradients into a lib which can even be linked in again from a normal cargo/rustc usage.<br>
However I'm not really convinced due to people updating their primary function without calling cargo-enzyme might link in a gradient function based on an older primary function, leading to hard to find bugs. Also, the compile times would become quite nasty.</p>



<a name="244041457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244041457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manuel Drehwald <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244041457">(Jun 27 2021 at 00:13)</a>:</h4>
<p>We don't have rerun-if-changed on a function level (is there another feature available to track such changes?), so I don't really now how to avoid such issues. Using data stored for incremental builds from extern sounds like having multiple pitfalls. Do you have some simpler solution in mind which might help here?</p>



<a name="244070893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244070893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244070893">(Jun 27 2021 at 15:09)</a>:</h4>
<p><span class="user-mention" data-user-id="123586">@nagisa</span> I can understand not wanting to support the plugin interface or similar things that change with LLVM version. But I would love to ship our built LLVM, as well as its copy of clang, so that people can do cross-language LTO and similar with it.</p>



<a name="244071816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244071816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244071816">(Jun 27 2021 at 15:31)</a>:</h4>
<p>I feel like that's way more likely to happen by the way of our not needing to ship LLVM at all, rather than us shipping more stuff.</p>



<a name="244072536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244072536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bstrie <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244072536">(Jun 27 2021 at 15:51)</a>:</h4>
<p>Not needing to ship LLVM at all, as in exclusively targeting stable LLVM releases? That sounds great, but I don't think there's ever been a point in Rust's history where it hasn't had either some custom LLVM patch or hasn't been pinned to some arbitrary LLVM trunk commit. Shipping clang via rustup at least seems within the realm of Rust's control</p>



<a name="244072917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244072917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244072917">(Jun 27 2021 at 16:00)</a>:</h4>
<p>LLVM 11 release was pretty good in terms of patches; the only long-standing patch we have that never makes it upstream is the one that teaches LLVM about Rust's allocation symbols.</p>



<a name="244072930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244072930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244072930">(Jun 27 2021 at 16:01)</a>:</h4>
<p>Which I think we would like to resolve regardless.</p>



<a name="244072983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244072983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244072983">(Jun 27 2021 at 16:02)</a>:</h4>
<p>There's also ongoing work to CI LLVM+Rust on the LLVM side, which should make the regressions (and therefore backports for them) significantly less common too.</p>



<a name="244072987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244072987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244072987">(Jun 27 2021 at 16:02)</a>:</h4>
<p>To be clear, I didn't mean this would be a very short term approach ^^</p>



<a name="244073267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244073267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244073267">(Jun 27 2021 at 16:08)</a>:</h4>
<p><span class="user-mention silent" data-user-id="348574">Manuel Drehwald</span> <a href="#narrow/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols/near/244041384">said</a>:</p>
<blockquote>
<p>Regarding your last message: This is indeed helpful for me to debug, but I guess it's hard to tell all Rust-AD folks to just build their own rustc version.</p>
</blockquote>
<p>Note that this is not necessarily a question of building their own rustc – it may be a one of using a different source to obtain rustc (e.g. distribution packages) than rustup.</p>



<a name="244073883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244073883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244073883">(Jun 27 2021 at 16:24)</a>:</h4>
<p>So, even if we don't in practice need to build our own LLVM, I still think there'd be value in the official distributions shipping the LLVM they use.</p>



<a name="244073886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244073886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244073886">(Jun 27 2021 at 16:24)</a>:</h4>
<p>And the clang built from that LLVM.</p>



<a name="244074793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244074793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244074793">(Jun 27 2021 at 16:48)</a>:</h4>
<p>Well, we already ship a bunch of llvm tools in the llvm-tools-preview component...</p>



<a name="244074846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244074846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244074846">(Jun 27 2021 at 16:48)</a>:</h4>
<p>But I do really think we should stay away from becoming a generic package manager and maintainers of all the packages therein. And perhaps figure out the line which we shouldn't cross (as we don't have one currently)</p>



<a name="244074858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244074858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244074858">(Jun 27 2021 at 16:49)</a>:</h4>
<p>And/or give people the ability to provide custom rustup components and whatnot.</p>



<a name="244080781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244080781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244080781">(Jun 27 2021 at 19:19)</a>:</h4>
<p>I'm definitely not looking for rustup to distribute arbitrary tools. There's a specific benefit to us distributing LLVM-based tools, so that people can use a unified Rust/C toolchain for LTO; otherwise, they won't have any means of doing so via the official rustup-distributed tools, and will <em>have</em> to rebuild Rust or use someone else's build of Rust.</p>



<a name="244081127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244081127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> William Moses <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244081127">(Jun 27 2021 at 19:28)</a>:</h4>
<p>Popping up a level, <span class="user-mention" data-user-id="123586">@nagisa</span> / others, what do you think the best mechanism for having Enzyme analyze rust code would be? Having people build rust from source, or download a custom rustc is a user experience issue that means setup may be too annoying for folks to use</p>



<a name="244081310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244081310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> William Moses <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244081310">(Jun 27 2021 at 19:33)</a>:</h4>
<p>Practically speaking, its able to build against LLVM 7-main, so most commits/custom forks should be fine?</p>



<a name="244083043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244083043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244083043">(Jun 27 2021 at 20:21)</a>:</h4>
<p>Yeah, probably. I don't know what the best way forward is wrt missing symbols.</p>



<a name="244083053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244083053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244083053">(Jun 27 2021 at 20:21)</a>:</h4>
<p>The enzyme shared library could provide those, perhaps <span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span></p>



<a name="244097944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244097944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> William Moses <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244097944">(Jun 28 2021 at 03:04)</a>:</h4>
<p>So my concern there with having a plugin provide them is that if some symbols involve the use of a shared datastructure (e.g. in llvm), then there might be a copy of said datastructure which could be bad.</p>
<p>When you say you already ship some llvm tools (say opt?), how does that work and could Enzyme extend the use of that for example?</p>
<p>Also does killing off those symbols really make such a big difference, even in the case of LTO? You could still enable LTO and get all the cross operator optimizations and keep the symbols. The only issue with keeping them around is potentially a larger binary?</p>



<a name="244106770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Expose%20LLVM%20Symbols/near/244106770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Expose.20LLVM.20Symbols.html#244106770">(Jun 28 2021 at 06:42)</a>:</h4>
<p>It also prevents removing or changing function arguments when an argument is known to be unused or constant.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>